From 1d93e3845626080bf52d1693896bf7b6d404a349 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 11 Jun 2019 15:48:07 +0000 Subject: [PATCH] testsuite: Be robust against broken focus When we start cycling on a subset, abort after a while. --- testsuite/gtk/test-focus-chain.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/testsuite/gtk/test-focus-chain.c b/testsuite/gtk/test-focus-chain.c index dac0d114ac..a76082feca 100644 --- a/testsuite/gtk/test-focus-chain.c +++ b/testsuite/gtk/test-focus-chain.c @@ -92,9 +92,10 @@ generate_focus_chain (GtkWidget *window, { char *first = NULL; char *last = NULL; - char *name; + char *name = NULL; GString *output = g_string_new (""); GtkWidget *focus; + int count = 0; gtk_widget_show (window); @@ -135,6 +136,7 @@ generate_focus_chain (GtkWidget *window, } g_string_append_printf (output, "%s\n", name); + count++; if (!first) first = g_strdup (name); @@ -142,9 +144,16 @@ generate_focus_chain (GtkWidget *window, g_free (last); last = g_strdup (name); + if (count == 100) + { + g_string_append (output, "ABORT\n"); + break; + } + g_free (name); } + g_free (name); g_free (first); g_free (last); -- 2.30.2